package com.yanyeori.webtest.service.impl.redistest;

import com.yanyeori.framework.core.util.JacksonUtil;
import com.yanyeori.framework.redis.listener.RedisListener;
import com.yanyeori.webtest.entity.clear.BankEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chenkuan
 * @version v1.0
 * @desc
 * @date 20/08/17 017 11:48
 */
@Slf4j
@Service
public class ListenerTest2 extends RedisListener<List<BankEntity>> {

    public static final String topic = "redis_topic_bankList";

    public ListenerTest2() {
        super(topic);
    }

    @Override
    protected void receive(List<BankEntity> message) {
        log.info("订阅到redis消息，topic={}，message={}", topic, JacksonUtil.toJson(message));
    }
}
